<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>李宁体育管理系统</title>

    <link rel="shortcut icon" href="favicon.ico">
    <link href="<%=path%>/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="<%=path%>/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="<%=path%>/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="<%=path%>/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="<%=path%>/css/plugins/chosen/chosen.css" rel="stylesheet">

    <link href="<%=path%>/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="<%=path%>/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="<%=path%>/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
          rel="stylesheet">
    <link href="<%=path%>/css/animate.min.css" rel="stylesheet">
    <link href="<%=path%>/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<style>
	.star{ width:400px; height:30px; margin:20px auto;}
	.star span{ width:30px; height:30px; background:url(<%=path%>/img/start_blank.png); display:inline-block; cursor:pointer; background-size:cover;}
	.star span.current{ background:url(<%=path%>/img/start_yellow.png);background-size:cover;}
	</style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t form"  id="signupForm"">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">公众号：</label>
								 
                            <div class="col-sm-4">
                                <input id="nickName" name="nickName" class="form-control" type="text" value="${map.nickName }" maxlength="32" placeholder="这里输入公众号" title="公众号" disabled>
                            </div>
                            <span id="error_nickName" style="color: red">*</span>
                        </div>
                       <input id="id" name="id" class="form-control" type="hidden" value="${map.id }" >
                        <div class="form-group">
                            <label class="col-sm-2 control-label">姓名：</label>

                            <div class="col-sm-4">
                                <input id="name" name="name" class="form-control" type="text"  value="${map.name }" maxlength="32" placeholder="姓名" title="姓名" disabled>
                            </div>
                            <span id="error_name" style="color: red">*</span>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号：</label>

                            <div class="col-sm-4">
                                <input id="mobile" name="mobile" class="form-control" type="number"   value="${map.mobile }" maxlength="11" placeholder="手机号" title="手机号" disabled>
                            </div>
                            <span id="error_mobile" style="color: red">*</span>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">店铺编号：</label>

                            <div class="col-sm-4">
                                <input id="storeCode" name="storeCode" class="form-control" type="text" value="${map.storeCode }"   maxlength="50" placeholder="这里输入店铺编号" title="店铺编号" disabled>
                            </div>
                            <span id="error_storeCode" style="color: red">*</span>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">提交时间：</label>

                            <div class="col-sm-4">
                                <input id="createdTime" name="createdTime" class="form-control" type="text" value="<fmt:formatDate value='${map.createdTime }' pattern='yyyy-MM-dd'/>"   maxlength="32" placeholder="这里输入提交时间" title="提交时间" disabled>
                            </div>
                            <span id="error_storeCode" style="color: red">*</span>
                        </div>


							<div class="form-group">
								<label class="col-sm-2 control-label" style="margin-top:10px">是否想再次光临：</label>
								<div class="col-sm-8">

											<div class="" style="margin: 5px">
												<ul class="tag-list" style="padding: 0">

													<li class="col-sm-2">
														<div
															class="checkbox checkbox-info checkbox-inline i-checks">
															<input type="checkbox" id="inlineCheckbox"
																value="1" disabled=''
																<c:if test="${map.isComeback==1||map.isComeback==null ||''==map.isComeback}"> checked</c:if> />

															<label for="inlineCheckbox"><a
																style="margin: -3px"><i class="fa fa-tag" style="width: 40px">是</i></a></label>
														</div>
													</li>
													<li class="col-sm-2">
														<div
															class="checkbox checkbox-info checkbox-inline i-checks">
															<input type="checkbox" id="inlineCheckbox"
																value="0" disabled=''
																<c:if test="${map.isComeback==0}"> checked</c:if> />

															<label for="inlineCheckbox"><a
																style="margin: -3px"><i class="fa fa-tag" style="width: 40px">否</i></a></label>
														</div>
													</li>
											<%-- 		<li class="col-sm-2">
														<div
															class="checkbox checkbox-info checkbox-inline i-checks">
															<input type="checkbox" id="inlineCheckbox"
																value="0" disabled=''
																<c:if test="${map.isComeback==null ||''==map.isComeback}"> checked</c:if> />

															<label for="inlineCheckbox"><a
																style="margin: -3px"><i class="fa fa-tag" style="width: 60px">再想想</i></a></label>
														</div>
													</li> --%>

												</ul>
											</div>

											</ul>
								</div>
								</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" style="margin-top:10px">是否想再次购买：</label>
								<div class="col-sm-8">

											<div class="" style="margin: 5px">
												<ul class="tag-list" style="padding: 0">

													<li class="col-sm-2">
														<div
															class="checkbox checkbox-info checkbox-inline i-checks">
															<input type="checkbox" id="inlineCheckbox"
																value="1" disabled=''
																<c:if test="${map.isBuyproduct==1||map.isBuyproduct==null ||''==map.isBuyproduct}"> checked</c:if> />

															<label for="inlineCheckbox"><a
																style="margin: -3px"><i class="fa fa-tag" style="width: 40px">是</i></a></label>
														</div>
													</li>
													<li class="col-sm-2">
														<div
															class="checkbox checkbox-info checkbox-inline i-checks">
															<input type="checkbox" id="inlineCheckbox"
																value="0" disabled=''
																<c:if test="${map.isBuyproduct==0}"> checked</c:if> />

															<label for="inlineCheckbox"><a
																style="margin: -3px"><i class="fa fa-tag" style="width: 40px">否</i></a></label>
														</div>
													</li>
													<%-- <li class="col-sm-2">
														<div
															class="checkbox checkbox-info checkbox-inline i-checks">
															<input type="checkbox" id="inlineCheckbox"
																value="0" disabled=''
																<c:if test="${map.isBuyproduct==null ||''==map.isBuyproduct}"> checked</c:if> />

															<label for="inlineCheckbox"><a
																style="margin: -3px"><i class="fa fa-tag" style="width: 60px">再想想</i></a></label>
														</div>
													</li> --%>

												</ul>
											</div>

											</ul>
								</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label" style="margin-top: 20px">店铺卫生：</label>
									<input id="storeHealth" name="storeHealth" class="form-control"
										type="hidden" value="${map.storeHealth }">
									<div class="col-sm-4 star">
										<div class="storeHealth">
											<span></span> <span></span> <span></span> <span></span> <span></span>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" style="margin-top: 20px">产品特点：</label>
									<input id="prodCharacter" name="prodCharacter"
										class="form-control" type="hidden"
										value="${map.prodCharacter }">
									<div class="col-sm-4 star">
										<div class="prodCharacter">
											<span></span> <span></span> <span></span> <span></span> <span></span>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" style="margin-top: 20px">产品舒适度：</label>
									<input id="prodComfort" name="prodComfort" class="form-control"
										type="hidden" value="${map.prodComfort }">
									<div class="col-sm-4 star">
										<div class="prodComfort">
											<span></span> <span></span> <span></span> <span></span> <span></span>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">会员留言：</label>
									<div class="col-sm-4">
										<textarea class="form-control" id="message" name="message"
											rows="3" placeholder="会员留言..." disabled>${map.message }</textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">运营者备注：</label>
									<div class="col-sm-4">
										<textarea class="form-control" id="remark" name="remark"
											rows="3" placeholder="运营者备注...">${map.remark }</textarea>
									</div>
									<span id="error_remark" style="color: red">*</span>
								</div>

								<div class="form-group">
									<div class="col-sm-4 col-sm-offset-3">
										<button class="btn btn-primary" type="submit">提交</button>
										&nbsp;
										<button class="btn btn-info" type="button" onclick="goback()">返回</button>
									</div>
								</div>
						</form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<%=path%>/js/jquery.min.js?v=2.1.4"></script>
<script src="<%=path%>/js/bootstrap.min.js"></script>
<script src="<%=path%>/js/jquery.validate.js"></script>
<script src="<%=path%>/js/jquery.serializeObject.js"></script>
<!--下拉框-->
<script src="<%=path%>/js/plugins/chosen/chosen.jquery.js"></script>

<script>
var config = {
        ".chosen-select": {},
        ".chosen-select-deselect": {allow_single_deselect: !0},
        ".chosen-select-no-single": {disable_search_threshold: 10},
        ".chosen-select-no-results": {no_results_text: "Oops, nothing found!"},
        ".chosen-select-width": {width: "95%"}
    };
    var score={};
/* $(".star .storeHealth span").click(function(){
	var _idx = $(this).index();
	score["storeHealth"]=_idx+1;
	$(".star .storeHealth span:lt("+_idx+1+")").addClass("current");
	$(".star .storeHealth span:gt("+_idx+")").removeClass("current");
});
$(".star .prodCharacter span").click(function(){
	var _idx = $(this).index();
	score["prodCharacter"]=_idx+1;
	$(".star .prodCharacter span:lt("+_idx+1+")").addClass("current");
	$(".star .prodCharacter span:gt("+_idx+")").removeClass("current");
});
$(".star .prodComfort span").click(function(){
	var _idx = $(this).index();
	score["prodComfort"]=_idx+1;
	$(".star .prodComfort span:lt("+_idx+1+")").addClass("current");
	$(".star .prodComfort span:gt("+_idx+")").removeClass("current");
	alert(JSON.stringify(score));
}); */

for (var selector in config)$(selector).chosen(config[selector]);
$(document).ready(
		function(){
		var storeHealth=$("#storeHealth").val()-1;
		var prodCharacter=$("#prodCharacter").val()-1;
		var prodComfort=$("#prodComfort").val()-1;
		score["storeHealth"]=storeHealth+1;
		score["prodCharacter"]=prodCharacter+1;
		score["prodComfort"]=prodComfort+1;
		$(".star .storeHealth span:lt("+storeHealth+1+")").addClass("current");
		$(".star .storeHealth span:gt("+storeHealth+")").removeClass("current");
		$(".star .prodCharacter span:lt("+prodCharacter+1+")").addClass("current");
		$(".star .prodCharacter span:gt("+prodCharacter+")").removeClass("current");
		$(".star .prodComfort span:lt("+prodComfort+1+")").addClass("current");
		$(".star .prodComfort span:gt("+prodComfort+")").removeClass("current");
		});
$("#signupForm").validate({
	rules: {
		id: {
			required: true,
			//url3:true
		},
		remark: {
			required: true,
		}

	},
	messages:{
		id:{
			required: "id不能为空"
		},
		remark:{
			required: "运营者备注不能为空"
		}
	
	},
	errorPlacement: function(error, element) {
		$( element ).closest( "form" ).find( "span[id='error_" + element.attr( "name" ) + "']" ).append( error );
	},
    onkeyup: false,
	submitHandler:function(){	
		var roleForm = $("#signupForm").serializeObject();
		roleForm=$.mergeJsonObject(roleForm,score);
		jQuery.ajax({
			type: "post",
		    url: "<%=path%>/order/doUpdateOrderEvaluate",
		    contentType: "application/json",
		    data: JSON.stringify(roleForm),
		    beforeSend:function() {
		    	$("#progress").modal();
		    	$("#loading").html("正在提交用戶数据，请稍候...");

		    },
		    complete:function(data) {
		    	$("#progress").modal('hide');
		    	$("#loading").html("");
		    }, 
		    success: function (data) {
		    	if(data.status==200){
		    		parent.layer.msg("保存评价详情数据信息成功!",{time: 500},function(){goback();});
		    	}else{
		    		parent.layer.msg("保存评价详情数据信息失败!");			    		
		    	}
		    },
		    error: function () {
		    	parent.layer.msg("保存评价详情数据信息失败,请联系管理员!");
		    }	
		});	
	}
});	
$.mergeJsonObject = function (jsonbject1, jsonbject2) {
	var resultJsonObject={};
	for(var attr in jsonbject1){
	resultJsonObject[attr]=jsonbject1[attr];
	}
	for(var attr in jsonbject2){
	resultJsonObject[attr]=jsonbject2[attr];
	}
	return resultJsonObject;
	};
    
    function goback() {
    	window.location.href="<%=path%>/order/orderEvaluate";
	}
</script>
</body>
</html>
